<html>
<body>

<ul id="myList"><li>Coffee</li><li>Tea</li></ul>

<p id="demo">Click the button to append an item to the list</p>

<button onclick="myFunction()">Try it</button>
<button onclick="mesTest()">Ajouter les jours</button>
<A HREF="javascript:window.close()">Fermer la fenetre</A>
<script type="text/javascript">
function myFunction()
{
var node=document.createElement("LI");
var textnode=document.createTextNode("Water");
node.appendChild(textnode);
document.getElementById("myList").appendChild(node);
}
function mesTest(){
var jours = new Array ();
jours[0] = "lundi";
jours[1] = "mardi";
jours[2] = "mercredi";
jours[3] = "jeudi";
jours[4] = "vendredi";
jours[5] = "samedi";
jours[6] = "dimanche";
for (i=0;i<jours.length;i++) {
var node=document.createElement("LI");
var textnode=document.createTextNode(jours[i]);
node.appendChild(textnode);
document.getElementById("myList").appendChild(node);
}
}
</script>

<p><strong>Note:</strong><br>First create an LI node,<br> then create a Text node,<br> then append the Text node to the LI node.<br>Finally append the LI node to the list.</p>

</body>
</html>

